Some minor cosmetic fixes to some of the demos.
GtkWidget *frame;
GtkWidget *bar;
GtkWidget *vbox;
- GtkWidget *vbox2;
GtkWidget *label;
GtkWidget *actions;
GtkWidget *button;
if (!window)
{
actions = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_widget_add_css_class (actions, "linked");
window = gtk_window_new ();
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Info Bars");
+ gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
gtk_container_add (GTK_CONTAINER (actions), button);
- frame = gtk_frame_new ("Info bars");
+ frame = gtk_frame_new ("An example of different info bars");
gtk_widget_set_margin_top (frame, 8);
gtk_widget_set_margin_bottom (frame, 8);
gtk_container_add (GTK_CONTAINER (vbox), frame);
- vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
- gtk_widget_set_margin_start (vbox2, 8);
- gtk_widget_set_margin_end (vbox2, 8);
- gtk_widget_set_margin_top (vbox2, 8);
- gtk_widget_set_margin_bottom (vbox2, 8);
- gtk_container_add (GTK_CONTAINER (frame), vbox2);
+ gtk_widget_set_halign (actions, GTK_ALIGN_CENTER);
- /* Standard message dialog */
- label = gtk_label_new ("An example of different info bars");
- gtk_container_add (GTK_CONTAINER (vbox2), label);
-
- gtk_container_add (GTK_CONTAINER (vbox2), actions);
+ gtk_widget_set_margin_start (actions, 8);
+ gtk_widget_set_margin_end (actions, 8);
+ gtk_widget_set_margin_top (actions, 8);
+ gtk_widget_set_margin_bottom (actions, 8);
+ gtk_container_add (GTK_CONTAINER (frame), actions);
}
if (!gtk_widget_get_visible (window))
/* Links
*
* GtkLabel can show hyperlinks. The default action is to call
- * gtk_show_uri_on_window() on their URI, but it is possible to override
+ * gtk_show_uri() on their URI, but it is possible to override
* this with a custom handler.
*/
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
GTK_BUTTONS_OK,
+ "Keyboard navigation");
+ gtk_message_dialog_format_secondary_markup (GTK_MESSAGE_DIALOG (dialog),
"The term <i>keynav</i> is a shorthand for "
"keyboard navigation and refers to the process of using "
"a program (exclusively) via keyboard input.");
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Links");
+ gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
label = gtk_label_new ("Some <a href=\"http://en.wikipedia.org/wiki/Text\""
- "title=\"plain text\">text</a> may be marked up\n"
- "as hyperlinks, which can be clicked\n"
- "or activated via <a href=\"keynav\">keynav</a>\n"
- "and they work fine with other markup, like when\n"
+ "title=\"plain text\">text</a> may be marked up "
+ "as hyperlinks, which can be clicked "
+ "or activated via <a href=\"keynav\">keynav</a> "
+ "and they work fine with other markup, like when "
"searching on <a href=\"http://www.google.com/\">"
"<span color=\"#0266C8\">G</span><span color=\"#F90101\">o</span>"
"<span color=\"#F2B50F\">o</span><span color=\"#0266C8\">g</span>"
"<span color=\"#00933B\">l</span><span color=\"#F90101\">e</span>"
"</a>.");
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+ gtk_label_set_max_width_chars (GTK_LABEL (label), 40);
+ gtk_label_set_wrap (GTK_LABEL (label), TRUE);
+ gtk_label_set_wrap_mode (GTK_LABEL (label), PANGO_WRAP_WORD);
g_signal_connect (label, "activate-link", G_CALLBACK (activate_link), NULL);
+ gtk_widget_set_margin_start (label, 20);
+ gtk_widget_set_margin_end (label, 20);
+ gtk_widget_set_margin_top (label, 20);
+ gtk_widget_set_margin_bottom (label, 20);
gtk_container_add (GTK_CONTAINER (window), label);
gtk_widget_show (label);
}
-/* Scale
+/* Scales
*
* GtkScale is a way to select a value from a range.
* Scales can have marks to help pick special values,
</object>
<object class="GtkWindow" id="window1">
<property name="title" translatable="yes">Scales</property>
+ <property name="resizable">0</property>
<child>
<object class="GtkGrid" id="grid1">
<property name="row-spacing">10</property>
-/* Spin Button
+/* Spin Buttons
*
* GtkSpinButton provides convenient ways to input data
* that can be seen as a value in a range. The examples
<interface>
<object class="GtkWindow" id="window1">
<property name="title" translatable="yes">Stack</property>
+ <property name="resizable">0</property>
<child>
<object class="GtkGrid">
<child>
<object class="GtkImage">
<property name="margin-top">20</property>
<property name="margin-bottom">20</property>
+ <property name="pixel-size">100</property>
<property name="icon-name">org.gtk.Demo4</property>
</object>
</property>